package com.gdkj.enums;

public enum StarDigSocialActionEnums {
    OTHER_DIG(1, "挖掘"),
    FILLING_SOLID(2, "填土"),
    CLOSE_BLACK_HOUSE(3, "关小黑屋"),
    UNLOCK_BLACK_HOUSE(4,"解除小黑屋")
    ;

    private Integer type;

    private String name;

    StarDigSocialActionEnums(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据type获取name值
     * @author chenyanqian
     * @date 2022/11/2
     * @param type : type
     * @return : java.lang.String
     */
    public static String getActionNameByType(Integer type){
        StarDigSocialActionEnums[] enums = StarDigSocialActionEnums.values();
        for (StarDigSocialActionEnums actionEnums : enums){
            if(actionEnums.type.equals(type)){
                return actionEnums.name;
            }
        }
        return null;
    }
}
